(1) Field of the Invention
The present invention relates to compiling apparatuses for compiling a source program written in the C language or an assembly language into a machine language program, and particularly to a compiling apparatus which secures error detectability in the source program, effectively utilizing a register included in a processor.
(2) Description of the Related Art
In processor-executable instructions, handling constants such as an immediate number and an address, when a bit width of the constants overflows a predetermined width for the instruction format, a single instruction alone cannot achieve the function. Thus, the instruction needs to be decomposed into several instructions, dividing the instruction into an instruction for configuring the constants and an instruction for computing.
In the meantime, there exists a conventional scheme for an effective reference to constants, decomposing a single instruction into several instructions when compiling the source program, as shown in the invention described in the Japanese Unexamined Patent Application Publication No. 08-6797.
Further, whether or not a value, such as an address, overflows cannot be found until object files linking. Therefore, there exists another scheme which: generates in advance a machine language code that uses single instructions when compiling; and decomposes the instructions that should be decomposed alone into several instructions when linking, utilizing an auxiliary register as needed.
However, in the case where the instruction is decomposed into several instructions when compiling before most of values, such as an address and a displacement, are not determined, the decomposition is performed on the instructions that should not be decomposed, as well. This results in inefficiency for use efficiency and a code size.
Moreover, the scheme that decomposes the instructions that should be decomposed alone when linking, utilizing the auxiliary register, requires the auxiliary register to be reserved. This results in problems, such as performance degradation by register pressure, an increase in hardware resources, and a decrease in hardware use efficiency because the auxiliary register cannot be used as a general register.
To address the above problems, the auxiliary register could possibly be shared for the general register use on the programmer's responsibility. However, no tools detect an error in misuse of the auxiliary register. This results in a decrease in debugability and development efficiency of programs.